package ar.com.larreta.grilla.client;

import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.grid.ColumnData;
import com.extjs.gxt.ui.client.widget.grid.Grid;
import com.extjs.gxt.ui.client.widget.grid.GridCellRenderer;
import com.google.gwt.i18n.client.NumberFormat;

public class NumberCellRenderer implements GridCellRenderer {

	protected com.extjs.gxt.ui.client.widget.table.NumberCellRenderer numberRenderer;
	
	public NumberCellRenderer(String patron) {
		super();
		numberRenderer = new com.extjs.gxt.ui.client.widget.table.NumberCellRenderer(NumberFormat.getFormat(patron));
	}

	
	
	public Object render(ModelData model, String property, ColumnData config,
			int rowIndex, int colIndex, ListStore store, Grid grid) {
		return numberRenderer.render(null, property, model.get(property));
	}

}
